package com.lmn.ribbon_server;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;

/**
 * 设置spring不去扫描被AvoidScan 注解标注的配置类，因为Ribbonclient的一些配置是对单个源配置的，不能用于全局，如果不排除启动会报错
 * ,可以对每个源配置对应的负责均衡策略
 */
@SpringBootApplication
@EnableEurekaClient
//@RibbonClient(name = "client-a", configuration = LoadBalanceConfiguration.class)
/*@RibbonClients(value = {
        @RibbonClient(name = "client-a", configuration = LoadBalanceConfiguration.class),
        @RibbonClient(name = "client-b", configuration = LoadBalanceConfiguration.class)
})*/
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ANNOTATION, value = {AvoidScan.class})})
public class RibbonServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(RibbonServerApplication.class, args);
    }
}
